import LayoutPage from "@/views/Layout/LayoutPage.vue";
import {
  Odometer,
  ShoppingCart,
  User,
  VideoCamera,
  Warning,
} from "@element-plus/icons-vue";
import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "Layout",
      component: LayoutPage,
      redirect: "/dashboard",
      children: [
        {
          path: "/dashboard",
          name: "dashboard",
          component: () => import("@/views/Dashboard/DashboardPage.vue"),
          meta: { title: "仪表盘", icon: Odometer },
        },
        {
          path: "/video",
          name: "video",
          component: () => import("@/views/Video/VideoPage.vue"),
          meta: { title: "视频管理", icon: VideoCamera },
        },
        {
          path: "/user",
          name: "user",
          component: () => import("@/views/User/UserPage.vue"),

          meta: { title: "用户管理", icon: User },
        },
        {
          path: "/order",
          name: "order",
          component: () => import("@/views/Order/OrderPage.vue"),

          meta: { title: "订单管理", icon: ShoppingCart },
        },
        {
          path: "/product",
          name: "product",
          component: () => import("@/views/Product/ProductPage.vue"),
          meta: { title: "分类管理", icon: ShoppingCart },
        },
        {
          path: "/merch",
          name: "merch",
          component: () => import("@/views/Merch/MerchPage.vue"),
          meta: { title: "商品管理", icon: ShoppingCart },
        },
        {
          path: "/supplier",
          name: "supplier",
          component: () => import("@/views/Supplier/SupplierPage.vue"),

          meta: { title: "供应商管理", icon: ShoppingCart },
        },
        {
          path: "/community",
          name: "community",
          component: () => import("@/views/Community/CommunityPage.vue"),

          meta: { title: "社区贴子", icon: Warning },
        }
      ],
    },
    {
      path: "/login",
      name: "login",
      component: () => import("@/views/Login/LoginPage.vue"),
    },
  ],
});

export default router;
